#!/bin/bash

setup_env() {
    # Disabling interactive progress bar, and spinners gains 2x performances
    # as stated on https://twitter.com/gavinjoyce/status/691773956144119808
    npm config set progress false
    npm config set spin false
}

install_app() {
    ./node_modules/.bin/bower install
}

install_addons() {
    cd lib

    cd wsd-core

    npm ci

    cd ../ui-toolkit

    npm ci

    cd ../..
}

install_backend() {
    cd ember-electron/backend

    npm ci

    cd ../..
}

setup_env
install_app
install_addons
install_backend
